﻿using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Input;
using System.Windows.Forms;
using System.Drawing;
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;


namespace ManagerUITestList
{
    /// <summary>
    /// Summary description for AddUserTest
    /// </summary>
    [CodedUITest]
    public class CodedUITest1
    {
        [TestMethod]
        public void AuthTest()
        {
            this.UIMap.SuccessAuthTest();
        }

        [TestMethod]
        public void FailAuthTest()
        {
            this.UIMap.FailAuthentificationTest();
        }

        [TestMethod]
        public void DragDropTest()
        {
            this.UIMap.DranDropTest();
        }

        [TestMethod]
        public void AddUserTest()
        {
        
        }

        #region Additional test attributes

        // You can use the following additional attributes as you write your tests:

        //Use TestInitialize to run code before running each test 
        [TestInitialize()]
        public void MyTestInitialize()
        {
            consoleHost = ApplicationUnderTest.Launch(@"E:\export\office-dinner\ConsoleHost\bin\Debug\ConsoleHost.exe");
            managerClient = ApplicationUnderTest.Launch(@"E:\export\office-dinner\RxSample1\bin\Debug\RxSample1.exe");
        }

        //Use TestCleanup to run code after each test has run
        [TestCleanup()]
        public void MyTestCleanup()
        {
            consoleHost.Close();
            managerClient.Close();
        }

        #endregion

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get { return testContextInstance; }
            set { testContextInstance = value; }
        }

        private TestContext testContextInstance;
        private ApplicationUnderTest consoleHost;
        private ApplicationUnderTest managerClient;

        public UIMap UIMap
        {
            get
            {
                if ((this.map == null))
                {
                    this.map = new UIMap();
                }

                return this.map;
            }
        }

        private UIMap map;
    }
}